#ifndef CASEDB_PARAMETER_HPP
#define CASEDB_PARAMETER_HPP

#include "CaseDB/ParamDirections.hpp"
#include "CaseDB/DbTypes.hpp"
#include <boost/any.hpp>

namespace CaseDB
{

/// @ingroup CaseDB
/// @brief It provides the metadata related to a parameter of a statement.
///
/// The parameter metadata consists of the type of the data, the direction and a value. The value is used as input (for 
///	input or input-output parameters) or it will be set when setting the output, after the execution of a statement, in 
///	the case of an output or input-output parameter.
class CASEDB_API Parameter
{
public:
	/// @brief It initializes the parameter.
	/// @param type the type id of the value bound to the parameter.
	/// @param direction the direction of the parameter
	/// @param value the value to be bound to the parameter.
	Parameter( DbTypes type, ParamDirections direction, boost::any value);

	/// @brief It initializes the parameter.
	/// @param type the type id of the value bound to the parameter.
	/// @param direction the direction of the parameter
	/// 
	/// The value of the parameter will be set tot NULL.
	Parameter( DbTypes type, ParamDirections direction);

	/// @brief It gets the value bound to the parameter.
	const boost::any& value() const { return value_; }

	/// @brief It sets the value to be bound to the parameter.
	void setValue( const boost::any& newVal) { value_ = newVal; }

	/// @brief It gets the type of the parameter value.
	DbTypes type() const { return type_; }

	/// @brief It gets the direction of the parameter.
	ParamDirections direction() const { return direction_; }

private:
	boost::any value_;
	DbTypes type_;
	ParamDirections direction_;
};

} // namespace CaseDB

#endif // CASEDB_PARAMETER_HPP
